# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=cookie-cadger
pkgver=1.08
pkgrel=2
groups=('blackarch' 'blackarch-fuzzer' 'blackarch-scanner')
pkgdesc='An auditing tool for Wi-Fi or wired Ethernet connections.'
url='https://cookiecadger.com/'
arch=('any')
license=('custom:FreeBSD')
depends=('java-environment' 'wireshark-cli')
noextract=("CookieCadger-$pkgver.jar")
source=("https://www.cookiecadger.com/files/CookieCadger-$pkgver.jar")
sha512sums=('7fb211b0be8f3763d28d2e87dfafdc052aff7d97e835d5dae8f65456ef11b76e202e801d8c86bee15c35d2aea0f2761c4b5d5115f5a891e39f3a94fa41d6599d')

package() {
  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp -L "CookieCadger-$pkgver.jar" "$pkgdir/usr/share/$pkgname"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec java -jar CookieCadger-$pkgver.jar "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

